package me.zhulu.outOfMemory;

/**
 * Created with IntelliJ IDEA.
 * User: herosea
 * Date: 14-5-7
 * Time: 下午5:43
 * To change this template use File | Settings | File Templates.
 */
public class JavaVMStackSOF {

    private int stackLength = 1;

    public void stackLeak(){
        stackLength++;
        stackLeak();
    }

    public static void main(String[] args) throws Throwable {
        JavaVMStackSOF javaVMStackSOF = new JavaVMStackSOF();
        try{
            javaVMStackSOF.stackLeak();
        } catch (Throwable e) {
            System.out.print(javaVMStackSOF.stackLength);
            throw e;
        }
    }
}
